<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>喜欢多云的季节i</title>
    <link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="https://code.jquery.com/jquery-3.0.0.min.js"></script>

    <script type="text/javascript" src="js/playview.js"></script>
    <style type="text/css">
        .myimg {
            margin-top:15px;
            width: 30px;
            height: 30px;
        }

        body {
            background-color: rgb(242,242,242);
            opacity: 0.7;
        }
        .imgBox{
            width: 1200px;
            height: 340px;
            margin: 0 auto;

        }

        .imgBox img{
            width: 1200px;
            height: 340px;
            margin: 0 auto;
            padding-top: 0px;

        }

        .img1{
            display: block;
        }

        .img2{
            display: none;
        }

        .img3{
            display: none;
        }
        .mydiv {
            margin: 0 auto;
        }
        .mydiv .mylink {
            height: 30px;
            font-size: 17px;
            margin-top: 20px;
            vertical-align: center;
            display: block;
            float: left;
            margin-left: 70px;
            color: black;
        }
    </style>

</head>
<body>
<nav class="navbar navbar-inverse">
    <div class="container-fluid" style="align-content: center">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <a class="navbar-brand" href="#">喜欢多云的季节</a>
        </div>
        <!-- Collect the nav links, forms, and other content for toggling -->
        <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
            <ul class="nav navbar-nav" style="align-content: center">
                <li class="active"><a href="#"  onclick="Toast()">签到 <span class="sr-only">(current)</span></a></li>
                <li class="active"><a th:href="@{/scenery/getSceneryByPageView}" target="iframe">浏览排行 <span class="sr-only">(current)</span></a></li>
                <li class="active"><a th:href="@{/scenery/getSceneryByDownLoad}" target="iframe">下载排行 <span class="sr-only">(current)</span></a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">分类 <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a th:href="@{/scenery/getAllScenery(mytype='scenery')}" target="iframe">风景</a></li>
                        <li><a th:href="@{/scenery/getAllScenery(mytype='galaxy')}" target="iframe">星空</a></li>
                        <li><a th:href="@{/scenery/getAllScenery(mytype='game')}" target="iframe">游戏</a></li>
                        <li><a th:href="@{/scenery/getAllScenery(mytype='anime')}" target="iframe">动漫</a></li>
                        <li><a th:href="@{/scenery/getAllScenery(mytype='beauty')}" target="iframe">美女</a></li>
                        <li><a th:href="@{/scenery/getAllScenery(mytype='animal')}" target="iframe">动物</a></li>
                    </ul>
                </li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">尺寸 <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="#">电脑壁纸 1920*1080</a></li>
                        <li><a th:href="@{/scenery/getAllScenery(mytype='phone')}"  target="iframe">手机壁纸 5120*1440</a></li>
                    </ul>
                </li>
                <li class="active"><a th:href="@{/scenery/getAllScenery(mytype='trends')}" target="iframe">动态 <span class="sr-only">(current)</span></a></li>
                <li class="active"><a th:href="@{/toConcern}">关于 <span class="sr-only">(current)</span></a></li>
                <li class="active"><a href="http://localhost:8081/payOrder?orderSn=123456">10元充值会员 <span class="sr-only">(current)</span></a></li>
            </ul>
            <form class="navbar-form navbar-left" th:action="@{/scenery/searchByName}" target="iframe">
                <div class="form-group">
                    <input type="text" class="form-control" placeholder="根据图片名称查询" name="myname">
                </div>
                <button type="submit" class="btn btn-default">查询</button>
            </form>
            <ul class="nav navbar-nav navbar-right">
                <li><img th:src="@{${session.visitor.image}}" class="myimg"></li>
                <li class="dropdown" style="color: white">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" th:text="${session.visitor.account}" aria-expanded="false" > <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a   onclick="function12()">通知</a></li>
                        <li><a th:href="@{/user/toUpdateInformation}">修改信息</a></li>
                        <li><a th:href="'/testurl'">更换背景</a></li>
                        <li><a th:href="'/user/toaddScenery'" target="iframe">上传图片</a></li>
                        <li><a th:href="'/user/collect?collect='+${session.visitor.collect}" target="iframe">我的收藏</a></li>
                        <li><a  onclick="Toast1()">我的积分</a></li>
                        <li><a th:href="@{/logout}">退出</a></li>
                    </ul>
            </ul>
        </div><!-- /.navbar-collapse -->
    </div><!-- /.container-fluid -->
</nav>
<div style="background-color: white;margin-top: 0%;width: 1200px;margin-left: 160px;">
    <marquee width="100%" height="30px" direction="left" scrollamount="15"
             onmouseover="this.stop()" onmouseout="this.start()">
        <span style="color: black;line-height: 30px;font-size: 30px;" th:text="${session.notice.title}+': '+${session.notice.content}"></span>&nbsp;&nbsp;&nbsp;
    </marquee>
</div>
<div class="imgBox">
    <img class="img-slide img1" src="images/1.jpg" alt="1">
    <img class="img-slide img2" src="images/2.jpg" alt="2">
    <img class="img-slide img3" src="images/3.jpg" alt="3">
</div>
<div style="width: 1200px;height: 60px;background-color:#d0d0d0;margin-bottom: 3px;margin-top: 3px	"   class="mydiv">
    <a th:href="@{/scenery/getAllScenery(mytype='scenery')}" target="iframe" class="mylink">风景</a>
    <a th:href="@{/scenery/getAllScenery(mytype='galaxy')}" target="iframe" class="mylink">星空</a>
    <a th:href="@{/scenery/getAllScenery(mytype='game')}" target="iframe" class="mylink">游戏</a>
    <a th:href="@{/scenery/getAllScenery(mytype='anime')}" target="iframe" class="mylink">动漫</a>
    <a th:href="@{/scenery/getAllScenery(mytype='beauty')}" target="iframe" class="mylink">美女</a>
    <a th:href="@{/scenery/getAllScenery(mytype='animal')}" target="iframe" class="mylink">动物</a>
    <a th:href="@{/scenery/getAllScenery(mytype='trends')}" target="iframe" class="mylink">动态</a>
    <a th:href="@{/scenery/getAllScenery(mytype='phone')}" target="iframe" class="mylink">手机壁纸</a>
</div>
<!--<img src="images/scenery/5.jpg" />-->

<iframe class="embed-responsive-item" src="/scenery/getAllScenery?mytype=scenery" NAME="iframe" style="width: 1200px;height: 1300px;margin-left: 160px;" scrolling="no" frameborder="no" >
</iframe>
<script src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery.min.js"></script>
<!--人物动画效果-->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/font-awesome/css/font-awesome.min.css"/>
<script src="https://cdn.jsdelivr.net/gh/stevenjoezhang/live2d-widget/autoload.js"></script>
<script>
    function Toast(msg,duration){
        duration=isNaN(duration)?3000:duration;
        var m = document.createElement('div');
        m.innerHTML = "签到成功，积分加五";
        m.style.cssText="width: 18%;min-width: 150px;opacity: 0.7;height: 30px;color: rgb(255, 255, 255);line-height: 30px;text-align: center;border-radius: 5px;position: fixed;top: 22%;left: 82%;z-index: 999999;background: rgb(0, 0, 0);font-size: 12px;";
        document.body.appendChild(m);
        setTimeout(function() {
            var d = 0.5;
            m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in';
            m.style.opacity = '0';
            setTimeout(function() { document.body.removeChild(m) }, d * 1000);
        }, duration);
        $.ajax({
            type: "POST",
            url: "http://localhost:8081/user/reward",
            data: {},
            success: function(result) {
            },
            dataType: "json"
        });
    }
    function Toast1(msg,duration){
        duration=isNaN(duration)?3000:duration;
        var m = document.createElement('div');
        $.ajax({
            type: "POST",
            url: "http://localhost:8081/user/getreward",
            data: {},
            success: function(result) {
                m.innerHTML = "我的积分:"+result;
                m.style.cssText="width: 18%;min-width: 150px;opacity: 0.7;height: 30px;color: rgb(255, 255, 255);line-height: 30px;text-align: center;border-radius: 5px;position: fixed;top: 22%;left: 82%;z-index: 999999;background: rgb(0, 0, 0);font-size: 12px;";
                document.body.appendChild(m);
                setTimeout(function() {
                    var d = 0.5;
                    m.style.webkitTransition = '-webkit-transform ' + d + 's ease-in, opacity ' + d + 's ease-in';
                    m.style.opacity = '0';
                    setTimeout(function() { document.body.removeChild(m) }, d * 1000);
                }, duration);
            },
            dataType: "json"
        });
    }
    function  function11(){

        $.ajax({
            type: "POST",
            url: "http://localhost:8081/user/getbackground",
            data: {},
            success: function(result) {
                document.body.style.background = result//通过js控制改变行内样式
                document.body.style.backgroundSize = "cover";
            },
            dataType: "json"
        });

    }
    function  function12(){

        $.ajax({
            type: "POST",
            url: "http://localhost:8081/admin/test",
            data: {},
            success: function(result) {
              alert(result.content)
                console.log(result)
            },
            dataType: "json"
        });

    }
    function11()
</script>
</body>
</html>